# 用户管理相关页面测试
from Lib.base.keywords import KeyWords
from selenium.webdriver.common.by import By
from Lib.common.common_function import *
from Lib.base.page_object.login_page import LonginPage
import uuid
import random


class CaseFlow(KeyWords):
    url = KeyWords.url + 'process-home'

    def create_flow(self):
        '''
        创建流程
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_flow\create_flow.yaml')
        element_operation(self, data[0]['data'])

    def flow_list(self):
        '''
        流程列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_flow\flow_list.yaml')
        element_operation(self, data[0]['data'])

    def flow_search_update(self):
        '''
        流程列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_flow\flow_search_update.yaml')
        element_operation(self, data[0]['data'])

    def flow_search_delete(self):
        '''
        流程列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\case_flow\flow_search_delete.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    driver = choose_browser()
    L = LonginPage(driver)
    L.login('kobeAdmin002', 'kobe8888')
    case = CaseFlow(driver)
    case.flow_search_update()
